Creating the ISCApplication Object

The entry point into the interface hierarchy of the API is through the ISCApplication interface. The ISCApplication interface provides access to the persistence units and sessions. You must create an instance of ISCApplication prior to using any of the other interfaces in the API.

Example 1

The following example illustrates how to use C++ to create the ISCApplication object:

#import "EAL.dll" using namespace SCAPI;
ISCApplicationPtr scAppPtr;
HRESULT hr;
hr = scAppPtr.CreateInstance(__uuidof(SCAPI::Application));

The following example illustrates how to use Visual Basic .NET to create the ISCApplication object:

Dim scApp As SCAPI.Application
scApp = New SCAPI.Application
// Or the alternative with the ProgId
Dim oApp As Object
oApp = CType(CreateObject("ewin9.SCAPI"), SCAPI.Application)